package com.suray.basic.wcs.plc.utils;

public enum LifterStatus {
    STANDY(1, "就绪"),
    RUNNING(2, "运行"),
    ERROR(200, "故障"),
    OFF_LINE(201, "离线");

    int value;
    String des;

    LifterStatus(int value, String des) {
        this.value = value;
        this.des = des;
    }

    public int getValue() {
        return value;
    }

    public static LifterStatus parseStatus(int value) {
        for (LifterStatus status : LifterStatus.values()) {
            if (status.value == value) {
                return status;
            }
        }

        throw new RuntimeException("状态转换出错：" + value);
    }

    @Override
    public String toString() {
        return des;
    }
}
